using Framework.Library;
using Framework.Library.Components;
using Framework.Module.Adsvertising.Lib.Data;
using Framework.Module.Adsvertising.Lib.DataAccess;

namespace Framework.Module.Adsvertising.Lib.Distributor
{
	public class PositionDistributor
	{
		private static int GetExpire()
		{
            return AppEnv.GetTimeCacheExpire;
		}
		public static PositionInfo GetInfoByPosition(string _position)
		{
			DataCaching dataCaching = new DataCaching();
			string _cacheKey = "AdvertisePositions.GetInfoByPosition";
			PositionInfo _retVal = (PositionInfo) dataCaching.GetHashCache(_cacheKey,_position);
			if (_retVal == null)
			{
				_retVal = PositionDB.GetInfoByPosition(_position);
				dataCaching.SetHashCache(_cacheKey,_position,GetExpire(),_retVal);
			}
			return _retVal;
		}
	}
}
